﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace TestHost
{
    static class Log
    {
        private static StreamWriter sw;

        public static void Initialize(string testName)
        {
            if (sw != null)
            {
                sw.Dispose();
                sw = null;
            }
            sw = new StreamWriter(testName + ".log", false, Encoding.UTF8);
        }
        public static void Finalize1()
        {
            sw.Close();
            sw.Dispose();
            sw = null;
        }

        public static void Write(string format, params object[] objs)
        {
            if (sw != null)
                sw.WriteLine("[{0}] {1}", DateTime.Now, String.Format(format, objs));
        }
    }
}
